import http from '@/utils/http'

//提交订单
export const addOrderListAPI = (products:any,address:any,totalMoney:any,discount:any,freightFee:any,pay:any)=>{
return  http.post('/api/orders',{
  products,address,totalMoney,discount,freightFee,pay
})
}

//订单支付
export const payOrderAPI = (id:any,method:any)=>{
  return  http.post(`/api/orders/${id}/pay`,{
    id,method
  })
  }

  //完成交易(收货)
  export const acceptAPI = (id:any)=>{
    return  http.post(`/api/orders/${id}/accept`)
   }
   //订单列表
   export const getOrderListAPI = ()=>{
    return  http.get('/api/orders')
   } 

   //删除订单
   export const deleteOrderAPI = (id:any)=>{
    return  http.delete(`/api/orders/${id}`)
   } 

   